//
// Created by ds on 24-7-12.
//

#ifndef ENTITY_H
#define ENTITY_H

#include <iostream>
#include <string>
#include <list>
#include <ostream>

using namespace std;

enum CarlaArgumentsEnum {
    World,
    IP,
    Port,
    StepLength,
    SimeTime,
    SyncColor,
    FedExeName,
    FedFile,
    FedName,
    Help
};

struct CarlaArguments {
    string world;
    string ip;
    int port;
    double stepLength;
    double simuTime;
    bool syncColor;
    const char* fedExeName;
    const char* fedFile;
    const char* fedName;

    static void help() {
        list<string> help;
        help.emplace_back("CarlaArguments参数用法:");
        help.emplace_back("    --help\t\t\t\t\t\t命令解释");
        help.emplace_back("    --world=<World>\t\t\t\tCarla场景的名称 (默认Town01)");
        help.emplace_back("    --ip=<IP>\t\t\t\t\t连接Carla的IP (默认localhost)");
        help.emplace_back("    --port=<PORT>\t\t\t\t连接Carla的Port (默认2000)");
        help.emplace_back("    --stepLength=<StepLength>\t仿真步长 (默认0.02s)");
        help.emplace_back("    --simutTime=<simutTime>\t\t仿真时间 (默认3600s)");
        help.emplace_back("    --syncColor\t\t\t\t\t是否同步颜色 (不写命令默认false)");
        help.emplace_back("    --fedExeName=<FedExeName>\t联邦执行名称 (默认Co-simulation)");
        help.emplace_back("    --fedFile=<FedFile>\t\t\t联邦文件 (默认Co-simulation-new.fed)");
        help.emplace_back("    --fedName=<FedName>\t\t\t联邦成员名称 (默认Carla)");
        for (const auto &i: help) {
            std::cout << i << std::endl;
        }
    }

    friend std::ostream &operator<<(std::ostream &os, const CarlaArguments &obj) {
        return os
               << "world: " << obj.world
               << ", ip: " << obj.ip
               << ", port: " << obj.port
               << ", stepLength: " << obj.stepLength
               << ", simuTime: " << obj.simuTime
               << ", syncColor: " << obj.syncColor
               << ", fedExeName: " << obj.fedExeName
               << ", fedFile: " << obj.fedFile
               << ", fedName: " << obj.fedName;
    }
};


#endif //ENTITY_H
